-
Notifications
You must be signed in to change notification settings - Fork 13.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: module scope should not require the app context #28378
Draft
mistercrunch
wants to merge
2
commits into
master
Choose a base branch
from
late_config
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dpgaspar
reviewed
May 8, 2024
a09b851
to
e8b23de
Compare
d3693a5
to
ea449c9
Compare
This is a major issue that's been plaguing the backend for a long time. Currently you can't simply run a simple `from superset import models` without getting an error about the app context missing. This DRAFT PR tries to evaluate what's getting in the way. So far I've identified: - app.config being referenced in module scope, this is mostly easy to fix for common configuration, where we can rely on flask.current_app and avoid module scope - dynamic/configurable model: this seems to be the core issue, where say we let people configure their EncryptedField's type - some reliance on SecurityManager, and SecurityManager.user_model used as a relationship, I think this can be worked around using sqlalchemy's `relationship("use-a-string-reference")` call - ???
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
api
Related to the REST API
doc
Namespace | Anything related to documentation
github_actions
Pull requests that update GitHub Actions code
review:draft
risk:db-migration
PRs that require a DB migration
size/XXL
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a major issue that's been plaguing the backend for a long time. Currently you can't simply run a simple
from superset import models
(or pretty much any other module import) without getting an error about the app context missing, and/or circular importsThis DRAFT PR tries to evaluate what's getting in the way. So far I've identified:
relationship("use-a-string-reference")
callTODO:
SQLALCHEMY_ENCRYPTED_FIELD_TYPE_ADAPTER
altogether (?) unless we can find some solutionTO-LOOK-INTO